package Views;


import java.util.Scanner;

/**
 * @author 张世豪
 * 主入口
 *
 */
public class MainPage {

    public void mainMenu() {
        System.out.println("****************************************");
        System.out.println("\n\t\t1.执行课程信息操作 \n");
        System.out.println("\t\t2.执行学生信息操作\n");
        System.out.println("\t\t3.查看学生信息（成绩按降序排列）\n");
        System.out.println("****************************************");
        System.out.println("请选择,输入数字或者按0退出：");
        Scanner input = new Scanner(System.in);
        boolean con = false;
        do {
            int num = input.nextInt();
            switch (num) {
                case 0:
                    System.out.println("谢谢您的使用！");
                    //writeArrays();
                    System.exit(0);
                    break;
                case 1:
                    System.out.println("执行添加课程信息操作\n\n");
                    CourseView addCourseInfo = new CourseView();
                    addCourseInfo.mainView();
                    break;
                case 2:
                    System.out.println("执行添加学生信息操作\n\n");
                    StudentView addStuInfo = new StudentView();
                    addStuInfo.mainView();
                    break;
                case 3:
                    System.out.println("****************************************");
                    AllStudentView allStudentView = new AllStudentView();
                    allStudentView.mainView();
                    System.out.println("****************************************");
                    break;
                default:
                    System.out.println("\n输入错误，请重新输入");
                    con = true;
                    break;
            }
        } while (con);
    }
}
